package com.epickrram.momento.agent;

import com.epickrram.momento.common.Agent;
import com.epickrram.momento.common.AgentResponse;

import java.io.File;

public final class AgentImpl implements Agent
{
    private final SnapshotRepository snapshotRepository;
    private final AgentResponse agentResponse;
    private final String agentId;

    public AgentImpl(final SnapshotRepository snapshotRepository,
                     final AgentResponse agentResponse,
                     final AgentIdFactory agentIdFactory)
    {
        this.snapshotRepository = snapshotRepository;
        this.agentResponse = agentResponse;
        this.agentId = agentIdFactory.createAgentId();
    }

    public void requestSnapshotLabels(final String correlationId)
    {
        agentResponse.receiveSnapshotLabels(agentId, correlationId, snapshotRepository.getSnapshotLabels());
    }

    public void ping(final String correlationId)
    {
        agentResponse.pingResponse(agentId, correlationId);
    }

    public void snapshotDirectory(final String correlationId, final String snapshotLabel, final File path)
    {
    }

    public void restoreDirectory(final String correlationId, final String snapshotLabel, final File path)
    {
    }

    public void executeCommand(final String correlationId, final String command, final File workingDir)
    {
    }
}